package com.hhj.king.eurake;


import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author KING
 * @date 2018/9/22 18:15
 */
@Slf4j
@EnableEurekaServer
@SpringBootApplication
public class FirstEurekaApp {
    /**
     * 请先在hosts中配置
     *
     * 127.0.0.1             srv1
     *
     * 127.0.0.1             srv2
     */
    public static void main(String[] args) {
        String str = "srv1";
        ConfigurableApplicationContext context = new SpringApplicationBuilder(FirstEurekaApp.class)
                // .properties("spring.config.location=classpath:/config/myapplication.properties")
                .properties("spring.profiles.active= " + str)
                .run(args);
        log.info("FirstEureka启动完毕....spring.profiles:{}", context.getEnvironment().getProperty("spring.profiles"));
    }
}
